from abc import ABC, abstractmethod  

# 定义一个抽象的动物类  
class Animal(ABC):  
    def __init__(self, name, species, breed, price):  
        self.name = name  
        self.species = species  
        self.breed = breed  
        self.price = price  

    @abstractmethod  
    def eat(self):  
        pass  

    @abstractmethod  
    def sleep(self):  
        pass  

    @abstractmethod  
    def play(self):  
        pass  

    @abstractmethod  
    def bark_or_meow(self):  
        pass  

# 小猫类  
class Kitten(Animal):  
    def __init__(self, name, breed, price):  
        super().__init__(name, 'Cat', breed, price)  
    
    def eat(self):  
        print(f"{self.name} 是一只小猫，正在吃饭。")  
    
    def sleep(self):  
        print(f"{self.name} 是一只小猫，正在睡觉。")  
    
    def play(self):  
        print(f"{self.name} 是一只小猫，在玩耍。")  
    
    def bark_or_meow(self):  
        print(f"{self.name} 小猫在玩耍时喵喵叫。")  

# 小狗类  
class Puppy(Animal):  
    def __init__(self, name, breed, price):  
        super().__init__(name, 'Dog', breed, price)  
    
    def eat(self):  
        print(f"{self.name} 是一只小狗，正在吃饭。")  
    
    def sleep(self):  
        print(f"{self.name} 是一只小狗，正在睡觉。")  
    
    def play(self):  
        print(f"{self.name} 是一只小狗，在玩耍。")  
    
    def bark_or_meow(self):  
        print(f"{self.name} 小狗在叫。")  

# 实例化小猫和小狗对象  
kitten1 = Kitten(name='小白', breed='布偶猫', price=1500)  
kitten2 = Kitten(name='小黑', breed='英短猫', price=1200)  

puppy1 = Puppy(name='小黄', breed='哈士奇', price=1800)  
puppy2 = Puppy(name='小白', breed='金毛', price=2000)  

# 测试方法  
kitten1.eat()  
kitten1.play()  
kitten1.bark_or_meow()  

puppy1.eat()  
puppy1.play()  
puppy1.bark_or_meow()

